﻿using System;
using System.ServiceModel;

namespace FirstFloor.Documents.IO
{
    /// <summary>
    /// The WCF contract
    /// </summary>
    [ServiceContract]
    public interface IDocumentWcfService
    {

        /// <summary>
        /// Begins the get document part.
        /// </summary>
        /// <param name="documentName">Name of the document.</param>
        /// <param name="partName">Name of the part.</param>
        /// <param name="callback">The callback.</param>
        /// <param name="state">The state.</param>
        /// <returns></returns>
        [OperationContract(AsyncPattern = true)]
        IAsyncResult BeginGetDocumentPart(string documentName, string partName, AsyncCallback callback, object state);

        /// <summary>
        /// Ends the get document part.
        /// </summary>
        /// <param name="result">The result.</param>
        /// <returns></returns>
        byte[] EndGetDocumentPart(IAsyncResult result);
    }
}
